Skip to content

refactor: Create global TooltipProvider in app.tsx to eliminate duplication#695

Merged
Shironex merged 2 commits intov0.14.0rcfrom
feature/bug-create-global-tooltip-provider-in-main-app-fi-ge48
Jan 25, 2026
Merged

refactor: Create global TooltipProvider in app.tsx to eliminate duplication#695
Shironex merged 2 commits intov0.14.0rcfrom
feature/bug-create-global-tooltip-provider-in-main-app-fi-ge48

Conversation

@Shironex
Copy link
Collaborator

@Shironex Shironex commented Jan 25, 2026

Summary

This PR implements the fix for GitHub Issue #694 by creating a single global TooltipProvider in the application root and removing all duplicate instances throughout the codebase.

Changes Implemented

  • Added global TooltipProvider to apps/ui/src/app.tsx wrapping the entire application (RouterProvider and SplashScreen)
  • Removed 36 duplicate TooltipProvider instances across 20 UI component files
  • Cleaned up imports by removing TooltipProvider from import statements in all affected component files (kept only Tooltip, TooltipTrigger, and TooltipContent)
  • Followed Radix UI best practices by providing TooltipProvider once at the application root instead of wrapping individual tooltip instances

Files Modified

Core Application

  • apps/ui/src/app.tsx - Added global TooltipProvider wrapper

Sidebar Components (3 files)

  • apps/ui/src/components/layout/sidebar/components/sidebar-navigation.tsx
  • apps/ui/src/components/layout/sidebar/components/sidebar-header.tsx
  • apps/ui/src/components/layout/sidebar/components/sidebar-footer.tsx

Board View Components (9 files)

  • apps/ui/src/components/views/board-view/board-controls.tsx
  • apps/ui/src/components/views/board-view/kanban-board.tsx
  • apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx
  • apps/ui/src/components/views/board-view/dialogs/edit-feature-dialog.tsx
  • apps/ui/src/components/views/board-view/dialogs/mass-edit-dialog.tsx
  • apps/ui/src/components/views/board-view/components/kanban-card/card-badges.tsx
  • apps/ui/src/components/views/board-view/components/list-view/list-row.tsx

Worktree Panel Components (4 files)

  • apps/ui/src/components/views/board-view/worktree-panel/components/tooltip-wrapper.tsx
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-tab.tsx
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown.tsx
  • apps/ui/src/components/views/board-view/worktree-panel/components/worktree-dropdown-item.tsx

Graph View Components (3 files)

  • apps/ui/src/components/views/graph-view/components/task-node.tsx
  • apps/ui/src/components/views/graph-view/components/graph-filter-controls.tsx
  • apps/ui/src/components/views/graph-view/components/graph-controls.tsx

Other Components (2 files)

  • apps/ui/src/components/ui/keyboard-map.tsx
  • apps/ui/src/components/views/settings-view/account/account-section.tsx

Benefits

  • Code Reduction: Net reduction of 62 lines (784 deletions, 722 insertions)
  • Improved Maintainability: Single source of truth for tooltip configuration
  • Better Performance: Eliminates redundant provider contexts
  • Best Practices: Follows Radix UI's recommended pattern for TooltipProvider placement
  • No Breaking Changes: All existing tooltip behavior is preserved

Testing

All tooltips across the application should continue to work as expected:

  • Sidebar tooltips (collapsed state)
  • Kanban board tooltips
  • Graph view tooltips
  • Keyboard shortcut tooltips
  • Settings dialogs tooltips
  • Worktree panel tooltips

Closes #694

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Running Agents entry with live count badges added to the sidebar (collapsed & expanded).
    • Dedicated Completed Features control with count on Kanban board.
  • UI

    • Documentation and Feedback areas reorganized for clearer access.
    • Keyboard/shortcut panel layout refined; shortcut badges and inline editing refreshed.
    • Filter panel reworked with clearer sections and a conditional "Clear All Filters" control.
  • Refactor

    • Simplified tooltip usage across the app for leaner UI rendering.

✏️ Tip: You can customize this high-level summary in your review settings.

…cation

- Add global TooltipProvider wrapper in app.tsx for entire application
- Remove 36 duplicate TooltipProvider instances across 20 UI component files
- Clean up imports by removing TooltipProvider from component imports
- Follow Radix UI best practices for TooltipProvider placement
- Reduce code by 62 lines while maintaining all tooltip functionality

Closes #694

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Consolidated TooltipProvider to the application root (apps/ui/src/app.tsx) and removed redundant TooltipProvider imports/wrappers across many UI components; individual Tooltip, TooltipTrigger, and TooltipContent usages remain unchanged.

Changes

Cohort / File(s) Summary
Root App Setup
apps/ui/src/app.tsx
Added global TooltipProvider wrapper at the app root (delayDuration={300}) to provide tooltip context for the whole tree.
Sidebar Components
apps/ui/src/components/layout/sidebar/components/sidebar-footer.tsx, apps/ui/src/components/layout/sidebar/components/sidebar-header.tsx, apps/ui/src/components/layout/sidebar/components/sidebar-navigation.tsx
Removed local TooltipProvider wrappers and imports; simplified tooltip usage to rely on global provider. Sidebar-footer includes navigation/tooltip text updates and running-agents badge logic.
Board View — Controls & Dialogs
apps/ui/src/components/views/board-view/board-controls.tsx, apps/ui/src/components/views/board-view/kanban-board.tsx, apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx, apps/ui/src/components/views/board-view/dialogs/edit-feature-dialog.tsx, apps/ui/src/components/views/board-view/dialogs/mass-edit-dialog.tsx
Removed TooltipProvider imports/wrappers; tooltips now rely on global provider. Kanban board refactors header actions (Complete/Completed features buttons and badges).
Board View — Cards & Lists
apps/ui/src/components/views/board-view/components/kanban-card/card-badges.tsx, apps/ui/src/components/views/board-view/components/list-view/list-row.tsx
Removed per-file TooltipProvider wrappers around badges; per-badge Tooltip structure preserved.
Board View — Worktree Panel
apps/ui/src/components/views/board-view/worktree-panel/components/tooltip-wrapper.tsx, .../worktree-dropdown.tsx, .../worktree-dropdown-item.tsx, .../worktree-tab.tsx
Removed TooltipProvider from imports/JSX; simplified tooltip rendering for branch names/status indicators to use the global provider.
Graph View Components
apps/ui/src/components/views/graph-view/components/graph-controls.tsx, .../graph-filter-controls.tsx, .../task-node.tsx
Eliminated local TooltipProvider wrappers; graph filter controls reorganized (search, category/status dropdowns, Clear All Filters) while keeping filtering logic intact.
Keyboard Map & Settings
apps/ui/src/components/ui/keyboard-map.tsx, apps/ui/src/components/views/settings-view/account/account-section.tsx
Removed TooltipProvider wrappers/imports; per-item tooltips remain.
Miscellaneous UI
apps/ui/src/components/views/board-view/components/worktree-panel/components/tooltip-wrapper.tsx, various small tooltip-wrapped components
General removal of duplicated TooltipProvider usage and import cleanup; preserved individual tooltip content and triggers across files.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • AutoMaker-Org/automaker#210 — Modifies the same sidebar components and tooltip/provider usage; closely related to sidebar changes in this PR.
  • AutoMaker-Org/automaker#160 — Changes tooltip exports and provider usage across the UI; touches the same tooltip API.
  • AutoMaker-Org/automaker#251 — Touches tooltip-wrapper.tsx; overlaps with this PR's work removing local TooltipProvider usage.

Suggested labels

Ready-To-Merge, scope: ui

Poem

🐰 I hopped through code with tiny paws,

Replaced repeated wraps—no flaws.
One provider now, neat and bright,
Tooltips hum from morning light.
Hooray! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: creating a global TooltipProvider in app.tsx and eliminating duplicate providers across the codebase.
Linked Issues check ✅ Passed The PR fully addresses issue #694 by adding a single global TooltipProvider in app.tsx and removing all 36 duplicate TooltipProvider instances across 20 component files, matching all stated objectives.
Out of Scope Changes check ✅ Passed All changes are directly in scope: adding global TooltipProvider in app.tsx and removing local TooltipProvider wrappers/imports from components. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the application's tooltip implementation by consolidating the TooltipProvider component. Previously, numerous TooltipProvider instances were scattered throughout various UI components, leading to code duplication and potential overhead. By moving a single TooltipProvider to the application's root (apps/ui/src/app.tsx), the change streamlines tooltip management, enhances code maintainability, and improves overall application performance by reducing redundant context providers. This update results in a net reduction of 62 lines of code and ensures all existing tooltip functionalities remain intact while adhering to modern UI library best practices.

Highlights

  • Centralized TooltipProvider: A single global TooltipProvider has been introduced in apps/ui/src/app.tsx to manage all tooltips across the application.
  • Eliminated Duplication: Over 36 redundant TooltipProvider instances were removed from 20 different UI component files, resulting in a net reduction of 62 lines of code.
  • Improved Code Structure: Imports were cleaned up in affected files, retaining only Tooltip, TooltipTrigger, and TooltipContent.
  • Adherence to Best Practices: The change aligns with Radix UI's recommended pattern for TooltipProvider placement, promoting better maintainability and performance.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Shironex Shironex self-assigned this Jan 25, 2026
@Shironex Shironex added Refactor A complete logic rewrite is requested or being performed for an issue. cleanup remove unused files in the codebase labels Jan 25, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request does a great job of centralizing the TooltipProvider at the application root, which is a best practice that improves maintainability and performance. However, there are a couple of important points to address. First, there's a critical issue in apps/ui/src/components/views/graph-view/components/task-node.tsx where TooltipProvider is removed from imports but still used in the component, which will break the build. Second, the new global TooltipProvider doesn't specify a delayDuration, so it will use the default of 700ms. Many of the removed providers had a delayDuration of 0ms or 200ms. This will change the tooltip behavior across the app, making them appear slower. The pull request description incorrectly states that all existing tooltip behavior is preserved. I've added specific comments with suggestions to address these points.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In
`@apps/ui/src/components/views/graph-view/components/graph-filter-controls.tsx`:
- Around line 147-166: The Tooltip and Popover are nested causing focus/open
conflicts; fix by either adding onOpenAutoFocus={(e) => e.preventDefault()} to
the PopoverContent used with Popover/PopoverTrigger (so the popover won't
auto-focus and trigger the Tooltip) or refactor to avoid nesting Tooltip +
PopoverTrigger by wrapping the Button with the existing TooltipWrapper pattern
(use TooltipTrigger/TooltipContent only around the Button, and keep
PopoverTrigger separate) to match other components and eliminate the focus/event
interference (look for Popover, PopoverTrigger, PopoverContent, Tooltip,
TooltipTrigger, TooltipContent, and TooltipWrapper in this file).

In `@apps/ui/src/components/views/graph-view/components/task-node.tsx`:
- Line 29: The file still references TooltipProvider but no longer imports it,
causing build failure; open the TaskNode component (task-node.tsx) and either
re-add the TooltipProvider import from '@/components/ui/tooltip'
or—preferably—remove any local TooltipProvider wrapper usage around Tooltip,
TooltipTrigger, TooltipContent (lines around 29 and the block around 289-333) so
the app-level TooltipProvider is used; ensure only Tooltip, TooltipTrigger,
TooltipContent remain imported and used.

In `@apps/ui/src/components/views/settings-view/account/account-section.tsx`:
- Line 11: The JSX still wraps parts of AccountSection with TooltipProvider
(referenced as TooltipProvider) but the import was removed; either re-add the
TooltipProvider import or—preferably—remove the local <TooltipProvider> wrapper
in account-section.tsx so the global provider is used; locate the
TooltipProvider usage around the Tooltip, TooltipTrigger, TooltipContent blocks
in the AccountSection component and delete the wrapper tags (or restore the
import if you intend a local provider).

- Add delayDuration={300} to global TooltipProvider in app.tsx to
  maintain consistent tooltip timing (previously many components used
  delayDuration={200}, so 300ms is a good compromise per review)
- Remove leftover TooltipProvider wrappers in task-node.tsx that were
  still referenced after import was removed (causing build failure)
- Remove leftover TooltipProvider wrapper in account-section.tsx
- Fix Tooltip+Popover nesting focus management issue in
  graph-filter-controls.tsx by adding onOpenAutoFocus={(e) =>
  e.preventDefault()} to PopoverContent components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/ui/src/components/views/graph-view/components/graph-filter-controls.tsx`:
- Around line 176-212: The row click plus Checkbox.onCheckedChange both fire and
can toggle twice; to fix, stop the pointer event from reaching the row by
preventing propagation on the Checkbox elements used in the four places: add a
pointer event handler that calls e.stopPropagation() (e.g. onPointerDown={(e) =>
e.stopPropagation()}) to each Checkbox in the Select All rows and in the
per-category and per-status rows (the Checkbox inside the JSX that references
selectedCategories/availableCategories and selectedStatuses/availableStatuses),
leaving the row onClick handlers (handleSelectAllCategories,
handleCategoryToggle, handleSelectAllStatuses, handleStatusToggle) intact so
clicks on the row still work but direct clicks on the Checkbox do not bubble.
🧹 Nitpick comments (1)
apps/ui/src/components/views/settings-view/account/account-section.tsx (1)

11-11: Consider importing Tooltip components from the components barrel (if available).

If Tooltip, TooltipTrigger, and TooltipContent are exported via the app’s components barrel, prefer that to a deep path to keep intra-app imports stable. Based on learnings, ...

Comment on lines +176 to +212
<div
className="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-accent cursor-pointer"
onClick={handleSelectAllCategories}
>
<Checkbox
checked={
selectedCategories.length === availableCategories.length &&
availableCategories.length > 0
}
onCheckedChange={handleSelectAllCategories}
/>
<span className="text-sm font-medium">
{selectedCategories.length === availableCategories.length
? 'Deselect All'
: 'Select All'}
</span>
</div>
</PopoverContent>
</Popover>

{/* Status Filter Dropdown */}
<Popover>
<Tooltip>
<TooltipTrigger asChild>
<PopoverTrigger asChild>
<Button
variant="ghost"
size="sm"
className={cn(
'h-8 px-2 gap-1.5',
selectedStatuses.length > 0 && 'bg-brand-500/20 text-brand-500'
)}
>
<CircleDot className="w-4 h-4" />
<span className="text-xs max-w-[120px] truncate">{statusButtonLabel}</span>
<ChevronDown className="w-3 h-3 opacity-50" />
</Button>
</PopoverTrigger>
</TooltipTrigger>
<TooltipContent>Filter by Status</TooltipContent>
</Tooltip>
<PopoverContent align="start" className="w-56 p-2">
<div className="space-y-2">
<div className="text-xs font-medium text-muted-foreground px-2 py-1">Status</div>

{/* Select All option */}
<div
className="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-accent cursor-pointer"
onClick={handleSelectAllStatuses}
>
<Checkbox
checked={selectedStatuses.length === STATUS_FILTER_OPTIONS.length}
onCheckedChange={handleSelectAllStatuses}
/>
<span className="text-sm font-medium">
{selectedStatuses.length === STATUS_FILTER_OPTIONS.length
? 'Deselect All'
: 'Select All'}
</span>
</div>
<div className="h-px bg-border" />

<div className="h-px bg-border" />

{/* Status list */}
<div className="space-y-0.5">
{STATUS_FILTER_OPTIONS.map((status) => {
const config = statusDisplayConfig[status];
const StatusIcon = config.icon;
return (
<div
key={status}
className="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-accent cursor-pointer"
onClick={() => handleStatusToggle(status)}
>
<Checkbox
checked={selectedStatuses.includes(status)}
onCheckedChange={() => handleStatusToggle(status)}
/>
<StatusIcon className={cn('w-3.5 h-3.5', config.colorClass)} />
<span className="text-sm">{config.label}</span>
</div>
);
})}
</div>
{/* Category list */}
<div className="max-h-48 overflow-y-auto space-y-0.5">
{availableCategories.length === 0 ? (
<div className="text-xs text-muted-foreground px-2 py-2">
No categories available
</div>
) : (
availableCategories.map((category) => (
<div
key={category}
className="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-accent cursor-pointer"
onClick={() => handleCategoryToggle(category)}
>
<Checkbox
checked={selectedCategories.includes(category)}
onCheckedChange={() => handleCategoryToggle(category)}
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid double‑toggling on checkbox rows.

On Line 176–186 and Line 204–212 (categories) and Line 252–259 and Line 275–283 (statuses), the row onClick plus Checkbox.onCheckedChange can both fire on pointer clicks, toggling twice and canceling the change. Consider stopping propagation from the Checkbox (or removing one handler) for both sections.

🔧 One minimal fix (apply to all four checkbox rows)
-                <Checkbox
+                <Checkbox
                   checked={
                     selectedCategories.length === availableCategories.length &&
                     availableCategories.length > 0
                   }
                   onCheckedChange={handleSelectAllCategories}
+                  onClick={(e) => e.stopPropagation()}
                 />
-                      <Checkbox
+                      <Checkbox
                         checked={selectedCategories.includes(category)}
                         onCheckedChange={() => handleCategoryToggle(category)}
+                        onClick={(e) => e.stopPropagation()}
                       />
-                <Checkbox
+                <Checkbox
                   checked={selectedStatuses.length === STATUS_FILTER_OPTIONS.length}
                   onCheckedChange={handleSelectAllStatuses}
+                  onClick={(e) => e.stopPropagation()}
                 />
-                      <Checkbox
+                      <Checkbox
                         checked={selectedStatuses.includes(status)}
                         onCheckedChange={() => handleStatusToggle(status)}
+                        onClick={(e) => e.stopPropagation()}
                       />

Also applies to: 252-283

🤖 Prompt for AI Agents
In `@apps/ui/src/components/views/graph-view/components/graph-filter-controls.tsx`
around lines 176 - 212, The row click plus Checkbox.onCheckedChange both fire
and can toggle twice; to fix, stop the pointer event from reaching the row by
preventing propagation on the Checkbox elements used in the four places: add a
pointer event handler that calls e.stopPropagation() (e.g. onPointerDown={(e) =>
e.stopPropagation()}) to each Checkbox in the Select All rows and in the
per-category and per-status rows (the Checkbox inside the JSX that references
selectedCategories/availableCategories and selectedStatuses/availableStatuses),
leaving the row onClick handlers (handleSelectAllCategories,
handleCategoryToggle, handleSelectAllStatuses, handleStatusToggle) intact so
clicks on the row still work but direct clicks on the Checkbox do not bubble.

@Shironex Shironex merged commit ebf2fca into v0.14.0rc Jan 25, 2026
8 checks passed
@Shironex Shironex deleted the feature/bug-create-global-tooltip-provider-in-main-app-fi-ge48 branch January 25, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup remove unused files in the codebase Refactor A complete logic rewrite is requested or being performed for an issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments